set terminal png
set output "1000_req_qps.png"
set title "Apache - Queries per second for 1000 requests sent"
set xlabel "timestamp"
set ylabel "queries executed"
set boxwidth 0.5
set style fill solid

overall1=`cat 1000_req_seq_v.txt | wc -l`
good1=`grep 200 1000_req_seq_v.txt | wc -l`
good_proc1=overall1/good1*100

overall2=`cat 1000_req_5_cur_v.txt | wc -l`
good2=`grep 200 1000_req_5_cur_v.txt | wc -l`
good_proc2=overall2/good2*100

overall3=`cat 1000_req_20_cur_v.txt | wc -l`
good3=`grep 200 1000_req_20_cur_v.txt | wc -l`
good_proc3=overall3/good3*100

plot "1000_req_seq.txt_qps.txt" using 2:xtic(1) with histogram title "seq - HTTP 200 responses in %: ".good_proc1, \
"1000_req_5_cur.txt_qps.txt" using 2:xtic(1) with histogram title "concurrent 5 - HTTP 200 responses in %: ".good_proc2, \
"1000_req_20_cur.txt_qps.txt" using 2:xtic(1) with histogram title "concurrent 20 - HTTP 200 responses in %: ".good_proc3

set terminal png
set output "100_req_qps.png"
set title "Apache - Queries per second for 100 requests sent"
set xlabel "timestamp"
set ylabel "queries executed"
set boxwidth 0.5
set style fill solid

overall1=`cat 100_req_seq_v.txt | wc -l`
good1=`grep 200 100_req_seq_v.txt | wc -l`
good_proc1=overall1/good1*100

overall2=`cat 100_req_5_cur_v.txt | wc -l`
good2=`grep 200 100_req_5_cur_v.txt | wc -l`
good_proc2=overall2/good2*100

overall3=`cat 100_req_20_cur_v.txt | wc -l`
good3=`grep 200 100_req_20_cur_v.txt | wc -l`
good_proc3=overall3/good3*100

plot "100_req_seq.txt_qps.txt" using 2:xtic(1) with histogram title "seq - HTTP 200 responses in %: ".good_proc1, \
"100_req_5_cur.txt_qps.txt" using 2:xtic(1) with histogram title "concurrent 5 - HTTP 200 responses in %: ".good_proc2, \
"100_req_20_cur.txt_qps.txt" using 2:xtic(1) with histogram title "concurrent 20 - HTTP 200 responses in %: ".good_proc3


set terminal png
set output "10000_req_qps.png"
set title "Apache - Queries per second for 10000 requests sent"
set xlabel "timestamp"
set ylabel "queries executed"
set boxwidth 0.5
set style fill solid

overall1=`cat 10000_req_seq_v.txt | wc -l`
good1=`grep 200 10000_req_seq_v.txt | wc -l`
good_proc1=overall1/good1*10000

overall2=`cat 10000_req_5_cur_v.txt | wc -l`
good2=`grep 200 10000_req_5_cur_v.txt | wc -l`
good_proc2=overall2/good2*10000

overall3=`cat 10000_req_20_cur_v.txt | wc -l`
good3=`grep 200 10000_req_20_cur_v.txt | wc -l`
good_proc3=overall3/good3*10000

plot "10000_req_seq.txt_qps.txt" using 2:xtic(1) with histogram title "seq - HTTP 200 responses in %: ".good_proc1, \
"10000_req_5_cur.txt_qps.txt" using 2:xtic(1) with histogram title "concurrent 5 - HTTP 200 responses in %: ".good_proc2, \
"10000_req_20_cur.txt_qps.txt" using 2:xtic(1) with histogram title "concurrent 20 - HTTP 200 responses in %: ".good_proc3

